home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / turlwin5.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.5 KB  |  50 lines

  1. //    Copyright (c) 1993, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TURLWindow
  4. //    Include File:    turlwind.h
  5. //    Purpose:    Provide a window for a URL
  6. //    Remarks/Portability/Dependencies/Restrictions:
  7. //    Revision History:
  8. //        12-27-93    created
  9. //        02-09-94    Split all members into seperate files.
  10. #include"turlwind.h"
  11.  
  12. void TURLWindow::dragView(TEvent& TE_event, unsigned char uc_mode, TRect&
  13.     TR_limits, TPoint TP_minSize, TPoint TP_maxSize)    {
  14. //    Purpose:    Capture the resizing of a window in order to
  15. //            correctly size the URL within.
  16. //    Arguments:    TE_event    The event occuring causing resize.
  17. //            uc_mode        Mode of the window.
  18. //            TR_limits    Limits size of window
  19. //            TP_minSize    Limits smallest size of window
  20. //            TP_maxSize    Limits maximum size of window
  21. //    Return Value:    void
  22. //    Remarks/Portability/Dependencies/Restrictions:
  23. //    Revision History:
  24. //        01-21-94    created
  25.  
  26.     //    Need to reload the URL if window chaned x size.
  27.     TRect oldTR = getExtent();
  28.  
  29.     //    Have the base resize.
  30.     TWindow::dragView(TE_event, uc_mode, TR_limits, TP_minSize,
  31.         TP_maxSize);
  32.  
  33.     TRect TR = getExtent();
  34.     //    Reload if x size changed.
  35.     if(oldTR.b.x != TR.b.x)    {
  36.         //    First take out the last item in the
  37.         //    history.  There will always be atleast
  38.         //    one entry.  Assume the reload will always
  39.         //    work.
  40.         auto char *cp_oldURL = (char *)(TNSCp_visited->
  41.             at(TNSCp_visited->getCount() - 1));
  42.  
  43.         TNSCp_visited->remove(cp_oldURL);
  44.         TNSCp_visited->pack();
  45.         delete(cp_oldURL);
  46.  
  47.         URLoader(TURLV->getURL());
  48.     }
  49. }
  50.